


public class Percolation {
    private int size;
    private boolean[][] grid;
    /**
     * Create N-by-N grid, with all sites blocked
     * @param N -- dimensional size of the grid.
     */
    public Percolation(int N){
        this.size = N;
        this.grid = new boolean[this.size][this.size];
        for (int r = 0; r < this.size; r++)
        {
            for (int c = 0; c < this.size; c++)
            {
                this.grid[r][c] = false;
            }
        }
    }
    
    /**
     * Open the site located at (i, j).
     * @param i -- index of row.
     * @param j -- index of column.
     */
    public void open(int i, int j)
    {
        if (i < 1 || j < 1 || i > this.size || j > this.size)
            throw new IndexOutOfBoundsException();
        this.grid[i - 1][j - 1] = true;
    }
    
    /**
     * Get whether the site is opened.
     * @param i -- index of row.
     * @param j -- index of column.
     * @return  true for open; false otherwise.
     */
    public boolean isOpen(int i, int j)
    {
        if (i < 1 || j < 1 || i > this.size || j > this.size)
            throw new IndexOutOfBoundsException();
        return this.grid[i - 1][j - 1];
    }
    
    /**
     * 
     * @param i
     * @param j
     * @return
     */
    public boolean isFull(int i, int j)
    {
        if (i < 1 || j < 1 || i > this.size || j > this.size)
            throw new IndexOutOfBoundsException();
        //TODO what does "full" mean here?
        return false;
    }
    
    /**
     * Does the system percolate?
     * @return  true for percolation; false otherwise.
     */
    public boolean percolates()
    {
        //TODO
        return false;
    }
    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        
    }

}
